
import React from 'react'
import { HashRouter, Route, Switch, Redirect } from 'react-router-dom'
import routes from './config'

import Out from './out'


class Routers extends React.Component {
  constructor(props) {
    super(props)

  }
  state = {

  }
  render() {
    return (
      <HashRouter >
        <Switch>
          {
            routes.map((r, i) =>  <Route strict={r.strict} key={i} path={r.path} exact={r.exact}
             render={props => <div> <Out {...props}  /><r.component {...props} routes={r.routes} /></div> }/>  )
          }
        </Switch>
      </HashRouter>
    )
  }
  enter = () => {
    console.log(this)
  }

}

export default Routers